package org.testile.placeholderscript;

import javax.script.ScriptEngine;

/**
 * A <code>PlaceholderTransformer</code> is used by {@link PlaceholderReplaceScriptEngine}
 * to replace found placeholders by <b>dynamic</b> content.
 *
 * @author hvizmar
 * @see PlaceholderReplaceScriptEngine
 */
public interface PlaceholderTransformer {

	/**
	 * Tests whether this transformer can be used to transform the current value.
	 * 
	 * @return suitable/not suitable
	 */
	boolean isSuitable(String value);

	/**
	 * Transforms a suitable string value to the replacement string.
	 * 
	 * @param suitableValue
	 * @return a transformed string
	 */
	String transform(String suitableValue);

	/**
	 * 
	 * @param engine
	 */
	void registerScriptEngine(ScriptEngine engine);
}
